home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
HAM_RAD
/
PROPAGAT
/
1004A.ZIP
/
MOONFIND.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-05-23
|
6KB
|
203 lines
1 REM ALL OK EXCEPT DOPPLER SHIFT IS SLIGHTLY OUT
10 REM MOON FINDER BY G3WDG
20 REM HAM RADIO TODAY JULY 84,P.28
30 SCREEN 0:CLS:WIDTH 40:KEY OFF
80 REM MOON LOCATION PROGRAM
90 REM DEFINED CONSTANTS
100 P5=2#*3.1415926535#
110 D5=360#/P5
120 R5=P5/360#
130 DEF FNA(X)=INT(X*D5*10+.5)/10
140 DEF FNB(X)=(X-INT(X))*P5
145 REM DATA INPUT SECTION
150 INPUT"LATITUDE DEG,MIN";L5,U5
160 INPUT"LONGITUDE DEG,MIN";L6,U6
170 LA=L5+INT((U5/60)*100)/100
180 LO=L6+INT((U6/60)*100)/100
190 L5=(L5+U5/60)*R5
200 L6=(L6+U6/60)*R5
210 INPUT"INCREMENT IN MINUTES";I
220 U5=INT((U5/60)*100)/100
230 U6=INT((U6/60)*100)/100
240 I6=100
250 GOTO 260
260 INPUT"DAY, MONTH, YEAR, TIME START, TIME FINISH";D,M,Y,B,E1
270 Y1=Y-(INT(Y/100)*100)
280 PRINT
290 PRINT
300 NS$="N"
310 IF LA<0 THEN NS$="S"
320 EW$="W"
330 IF LO<0 THEN EW$="E"
340 PRINT "MOON ";D;"/";M;"/";Y1:PRINT"FROM LAT= ";LA*SGN(LA);NS$;" LONG= ";LO*SGN(LO);EW$
350 F1=0
360 PRINT
370 I1=2
375 REM CALCULATION OF JULIAN DATE
380 IF M>=3 THEN 460
390 IF INT((Y-1853)/4)<11 THEN GOTO 420
400 C1=-1
410 GOTO 430
420 C1=0
430 J1=365*(Y-1853)+D+30*(M+9)+INT((M+10)/2)
440 J2=INT((Y-1853)/4)+1+C1
450 GOTO 570
460 IF INT((Y-1852)/4)<11 THEN GOTO 490
470 C1=-1
480 GOTO 500
490 C1=0
500 IF M=9 THEN 540
510 IF M=11 THEN 540
520 C2=0
530 GOTO 550
540 C2=1
550 J1=365*(Y-1852)+D+30*(M-3)+INT((M-2)/2)
560 J2=INT((Y-1852)/4)+C1+C2
570 J=J1+J2
580 T1=J-17472.5
585 REM CALCULATION OF DAYS SINCE LAST PERIGEE AND AGE OF MOON
590 T9=J+2397547.5#
600 T9=T9-2444507.6#
610 T7=T9-14.6
620 T8=INT(T7/29.5306)
630 T8=T7-T8*29.5306
640 Q=INT(T9/27.5545)
650 R=T9-(27.5455*Q)
660 S=24*R
665 REM START OF MAIN CALCULATION LOOP
670 D9=(B-INT(B/100)*100)+INT(B/100)*60
680 D6=(E1-INT(E1/100)*100)+INT(E1/100)*60
690 D7=D9-D6
700 D8=D7-I
710 IF D7>=0 THEN GOTO 730
720 GOTO 750
730 IF D8>=0 THEN GOTO 1840
740 B=E1
745 REM CALCULATION OF LUNAR LAT & LONG
750 T=(B-INT(B/100)*100)/1440+INT(B/100)/24
760 T5=T1+T
770 K1=FNB(.751213+.036601102#*T5)
780 K2=FNB(.822513+.03629116457#*T5)
790 K3=FNB(.995766+2.73777825E-03*T5)
800 K4=FNB(.974271+.0338631922#*T5)
810 K5=FNB(.0312525+.0367481957#*T5)
820 L8=K1+.658*R5*SIN(2*K4)+6.289*R5*SIN(K2)
830 L8=L8-1.274*R5*SIN(K2-2*K4)-.186*R5*SIN(K3)
840 L8=L8+.214*R5*SIN(2*K2)-.114*R5*SIN(2*K5)
850 L8=L8-.059*R5*SIN(2*K2-2*K4)-.057*R5*SIN(K2+K3-2*K4)
860 K6=K5+.6593*R5*SIN(2*K4)+6.2303*R5*SIN(K2)-1.272*R5*SIN(K2-2*K4)
870 L7=5.144*R5*SIN(K6)-.146*R5*SIN(K5-2*K4)
875 REM CALCULATION OF LUNAR RA & DEC
880 D1=COS(L7)*SIN(L8)*.397821+SIN(L7)*.917436
890 D1=ATN(D1/(SQR(1-D1^2)))
900 G1=50+.5+((D1)/(.792))*D5
910 G2=80+((D1)/(.808))*D5
920 G3=141.5-((D1)*(.738)*D5)
930 G4=170.5-((D1)*(.857)*D5)
940 A2=(COS(L7)*COS(L8))/COS(D1)
950 A1=(COS(L7)*SIN(L8)*.917436-SIN(L7)*.397821)/COS(D1)
960 A=ATN(A1/A2)
970 GOSUB 1230
980 R1=A
990 L1=.065709822#*T1
1000 L=T*24*1.002738#+6.646055#+(L1-INT(L1/24)*24)
1010 L=(L-INT(L/24)*24)
1015 REM CALCULATION OF GHA FROM LOCAL SIDEREAL TIME
1020 G=(L/24)*P5-R1
1030 IF G<P5 THEN GOTO 1060
1040 G=G-P5
1050 GOTO 1090
1060 IF G<0 THEN GOTO 1080
1070 GOTO 1090
1080 G=G+P5
1085 REM CALCULATION OF LHA FROM GHA
1090 H=L6-G
1095 REM CALCULATION OF ELEVATION
1100 E3=COS(L5)*COS(H)*COS(D1)+SIN(D1)*SIN(L5)
1110 E2=SQR(1-(E3*E3))
1115 REM PARALLAX CORRECTION FOR ELEVATION
1120 E=ATN((E3/E2)-(1/(61.33*E2)))
1130 F=ATN(E3/E2)
1135 REM JUMP TO TIME INCREMENTING ROUTINE IF MOON IS BELOW HORIZON
1140 IF E<0 THEN GOTO 1770
1150 IF E>I6*R5 THEN GOTO 1770
1155 REM CALCULATION OF AZIMUTH
1160 A2=SIN(D1)/(COS(L5)*COS(F))
1170 A2=A2-(SIN(L5)/COS(L5))*(SIN(F)/COS(F))
1180 A1=SIN(L5)*SIN(D1)+COS(L5)*COS(D1)*COS(H)
1190 A1=(SIN(H)*COS(D1))/SQR(1-A1^2)
1200 A=ATN(A1/A2)
1210 GOSUB 1230
1220 GOTO 1370
1225 REM SUBROUTINE TO REMOVE AMBIGUITIES ASSOICATED WITH ATN FUNCTION
1230 IF A=0 THEN GOTO 1250
1240 GOTO 1280
1250 IF A2<0 THEN GOTO 1270
1260 GOTO 1360
1270 GOTO 1360
1280 IF A>0 THEN GOTO 1340
1290 IF A2<0 THEN GOTO 1320
1300 A=P5+A
1310 GOTO 1360
1320 A=P5+(A-P5/2)
1330 GOTO 1360
1340 IF A2=>0 THEN GOTO 1360
1350 A=A+P5/2
1360 RETURN
1365 REM CALCULATION OF DOPPLER SHIFTFOR ECHOES ON 432 MHZ
1370 D7=-.38*(SIN(.526*S/57.3))
1380 F=432*(D7-(3.1*COS(D1)*COS(L5)*SIN(-1*H)))
1390 F=INT(F)
1400 IF (T-I1)>(2*I)/1440 THEN GOTO 1420
1410 GOTO 1430
1420 PRINT
1430 IF INT(B+.5)>9 THEN GOTO 1460
1435 REM ROUTINE FOR PUTTING LEADING ZEROS IN FRONT OF TIME(B=TIME)
1440 S$="000"
1450 GOTO 1530
1460 IF INT(B+.5)>99 THEN GOTO 1490
1470 S$="00"
1480 GOTO 1530
1490 IF INT(B+.5)>999 THEN GOTO 1520
1500 S$="0"
1510 GOTO 1530
1520 S$=""
1530 Z1=FNA(A)
1540 Z2=FNA(E)
1550 Z3=FNA(G)
1560 Z4=FNA(D1)
1570 IF F1=1 THEN GOTO 1650
1580 R1=INT(R)
1590 PRINT"DAYS SINCE PERIGEE= ";R1
1600 PRINT"AGE OF MOON= ";INT(T8*10)/10;" DAYS"
1610 PRINT
1620 PRINT" GMT AZ EL GHA DEC DOP"
1630 PRINT" --- -- -- --- --- ---"
1640 F1=1
1650 PRINT INT(B+.5);
1660 PRINT TAB(7);
1670 PRINT Z1;
1680 PRINT TAB(14);
1690 PRINT Z2;
1700 PRINT TAB(20);
1710 PRINT Z3;
1720 PRINT TAB(27);
1730 PRINT Z4;
1740 PRINT TAB(34);
1750 PRINT F
1760 I1=T
1765 REM TIME INCREMENTING ROUTINE
1770 HR=INT(B/100)
1780 MN=B-100*HR
1790 MN=MN+I
1800 B=100*(HR+INT(MN/60))
1810 MN=MN-(INT(MN/60))*60
1820 B=B+MN
1825 REM LOOP BACK TO MAIN CALCULATIONS
1830 GOTO 670
1840 PRINT
1850 PRINT"RE-RUN PROGRAM (Y/N)";
1860 INPUT D$
1870 IF D$="Y" THEN GOTO 100
1880 END